package com.cykj.admin.controller;

import com.cykj.admin.annotation.MyLog;
import com.cykj.admin.service.IEnterpriseService;
import com.cykj.admin.vo.HRVO;
import com.cykj.admin.vo.IndustryVO;
import com.cykj.common.dto.ResponseDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @BelongsProject:@BelonqsPackage:com.cykj.admin.controller
 * @Author:jiangna
 * @CreateTime:2025-08-16 11:21
 */
//平台端对企业的操作
//1.hr管理  2.行业管理
@Tag(name = "EnterpriseController",description = "平台端对hr和行业管理的接口")
@RestController
@RequestMapping("enterprise")
public class EnterpriseController {

    @Autowired
    private  IEnterpriseService enterpriseService;

//对HR的操作

    /**
    * @Description: 查询所有的HR的信息 / 根据所属企业 账号查询
    * @Param: [hrvo]
    * @return: com.cykj.common.dto.ResponseDTO
    */
    @Operation(summary = "平台端查询所有的HR的信息接口")
    @GetMapping("selectByHr")
    public ResponseDTO selectByHr(HRVO hrvo){
        System.out.println(hrvo);
        return enterpriseService.selectByHr(hrvo);
    }

    /**
    * @Description: 重置HR密码
    * @Param: []
    * @return: com.cykj.common.dto.ResponseDTO
    */
    @MyLog("重置HR密码")
    @Operation(summary = "平台端重置HR密码接口")
    @PutMapping("resetPassword/{hrId}")
    public ResponseDTO resetPassword(@PathVariable("hrId") Integer hrId){
        return enterpriseService.resetPassword(hrId);
    }

    /**
    * @Description: 拉黑HR（软删除）
    * @Param: [hrId]
    * @return: com.cykj.common.dto.ResponseDTO
    */
    @MyLog("拉黑HR")
    @Operation(summary = "平台端拉黑HR的接口")
    @DeleteMapping("deleteHR")
    public ResponseDTO deleteHR(HRVO hrvo){
        return enterpriseService.deleteHR(hrvo);
    }
}
